<?php $this->load->view('header') ?>

<!-- start content-outer -->
<div id="content-outer">
    <!-- start content -->
    <div id="content">


        <div id="page-heading"><h1>View / Edit Service</h1></div>


        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
            <tr>
                <th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
                <th class="topleft"></th>
                <td id="tbl-border-top">&nbsp;</td>
                <th class="topright"></th>
                <th rowspan="3" class="sized"><img src="<?php echo base_url(); ?>images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
            </tr>
            <tr>
                <td id="tbl-border-left"></td>
                <td>
                    <!--  start content-table-inner -->
                    <div id="content-table-inner">

                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                            <tr valign="top">
                                <td>

                                    <?php if (isset($sys_msg) && $sys_msg == "created") { ?>

                                        <!--  start message-blue -->
                                        <div id="message-blue">
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td class="blue-left">New Service created successfully.</td>
                                                    <td class="blue-right"><a class="close-blue"><img src="<?php echo base_url(); ?>images/table/icon_close_blue.gif"   alt="" /></a></td>
                                                </tr>
                                            </table>
                                        </div>
                                        <!--  end message-blue -->

                                    <?php } ?>

                                    <?php if (isset($sys_msg) && $sys_msg == "updated") { ?>

                                        <!--  start message-blue -->
                                        <div id="message-blue">
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td class="blue-left">Service updated successfully.</td>
                                                    <td class="blue-right"><a class="close-blue"><img src="<?php echo base_url(); ?>images/table/icon_close_blue.gif"   alt="" /></a></td>
                                                </tr>
                                            </table>
                                        </div>
                                        <!--  end message-blue -->

                                    <?php } ?>

                                    <?php if (isset($sys_msg) && $sys_msg == "removed") { ?>

                                        <!--  start message-blue -->
                                        <div id="message-blue">
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td class="blue-left">Service image removed.</td>
                                                    <td class="blue-right"><a class="close-blue"><img src="<?php echo base_url(); ?>images/table/icon_close_blue.gif"   alt="" /></a></td>
                                                </tr>
                                            </table>
                                        </div>
                                        <!--  end message-blue -->

                                    <?php } ?>

                                    <!--  start step-holder -->
                                    <div id="step-holder">
                                        <div class="step-no">1</div>
                                        <div class="step-dark-left">Service Details</div>
                                        <div class="step-dark-right">&nbsp;</div>
                                        <div class="step-no-off">2</div>
                                        <div class="step-light-left"><a href="<?php echo base_url(); ?>services/view/2/<?php echo $service->Service_ID; ?>" >Side Content</a></div>
                                        <div class="step-light-round">&nbsp;</div>
                                        <div class="clear"></div>
                                        <div class="clear"></div>
                                    </div>
                                    <!--  end step-holder -->

                                    <!-- start id-form -->
                                    <form action="<?php echo base_url(); ?>services/update" class="validateform" method="post">

                                        <input type="hidden" name="serviceid" value="<?php echo $service->Service_ID; ?>" />

                                        <table border="0" cellpadding="0" cellspacing="0"  id="id-form" class="services">
                                            <tr>
                                                <th valign="top"><span class="mandate">*</span>Title:</th>
                                                <td><input type="text" name="title" id="title" class="inp-form required" value="<?php echo $service->title; ?>" /></td>
                                                <td>
                                                    <label class="error" for="title">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th valign="top"><span class="mandate">*</span>Slug:</th>
                                                <td><input type="text" name="slug" id="slug" class="inp-form required" value="<?php echo $service->slug; ?>" /></td>
                                                <td>
                                                    <label class="error" for="slug">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th valign="top">Sequence:</th>
                                                <td><input type="text" name="sequence" id="sequence" value="<?php echo $service->sequence; ?>" class="inp-form required" /></td>
                                                <td>
                                                    <label class="error" for="sequence">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>

                                            <tr>
                                                <th valign="top"><span class="mandate">*</span> Status:</th>
                                                <td>
                                                    <div class="select_holder">		
                                                        <select  class="styledselect_form_1" id="status" name="status">
                                                            <option value="1" <?php
                                    if ($service->status == '1') {
                                        echo 'selected="selected"';
                                    }
                                    ?>>Active</option>
                                                            <option value="0" <?php
                                    if ($service->status == '0') {
                                        echo 'selected="selected"';
                                    }
                                    ?>>Inactive</option>
                                                        </select>
                                                    </div>
                                                </td>
                                                <td>
                                                    <label class="error" for="status">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td colspan="3" ><div class="form_divider"></div></td><!--------------------------------------------------------------------->
                                            </tr>
                                            <tr>
                                                <th valign="top"><span class="mandate">*</span>Short Description:</th>
                                                <td style="width:600px;"><textarea rows="" cols="" name="short_description" id="short_description" class="ckeditor required"><?php echo $service->short_description; ?></textarea></td>
                                                <td>
                                                    <label class="error" for="short_description">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th valign="top"><span class="mandate">*</span>Description:</th>
                                                <td style="width:600px;"><textarea rows="" cols="" name="description" id="description" class="ckeditor required"><?php echo $service->description; ?></textarea></td>
                                                <td>
                                                    <label class="error" for="description">
                                                        <div class="error-left"></div>
                                                        <div class="error-inner">This field is required.</div>	
                                                    </label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <th>&nbsp;</th>
                                                <td valign="top">
                                                    <input type="submit" value="" class="form-submit" />
                                                    <input type="reset" value="" class="form-reset"  />
                                                </td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </form>
                                    <!-- end id-form  -->

                                    <form method="post" action="<?php echo base_url() ?>services/remove_media/<?php echo $service->Service_ID; ?>" >
                                        <table style="width:100%;" class="services">
                                            <tr>
                                                <td colspan="3" ><div class="form_divider"></div></td><!--------------------------------------------------------------------->
                                            </tr>
                                            <tr>
                                                <td colspan="3">&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <th valign="top" style="padding-right:30px;">Upload Service Image:</th>
                                                <td>
                                                    <div class="upload_portion" >

                                                        <!--label for="Filedata">Upload photo(s)</label-->

                                                        <input type="file" name="Filedata" value="" id="upload-photo" />                                            
                                                        <a class="upload-img-btn" href="javascript:$('#upload-photo').uploadifyUpload();">Upload File(s)</a>

                                                    </div>

                                                </td>
                                                <td></td>
                                            </tr>

                                            <tr>
                                                <td>&nbsp;</td>
                                                <td colspan="2" id="mediaphoto_content" style="border-top:dotted 1px #ccc;">

                                                    <?php
                                                    if ($service_media != false && $service_media->num_rows() > 0) {
                                                        foreach ($service_media->result() as $mediaitem) {

                                                            if (trim($mediaitem->image_name) != '') {
                                                                ?>


                                                                <h1><span>Uploaded Service Image</span></h1>

                                                                <table class="result_table">
                                                                    <tr class="header">
                                                                        <td>&nbsp;</td>
                                                                        <td>File</td>
                                                                        <td>File Name</td> 
                                                                    </tr>



                                                                    <tr class="data_row">
                                                                        <td>&nbsp;</td>
                                                                        <td>
                                                                            <a href="<?php echo $this->config->item("media_folder_service") . $mediaitem->image_name; ?>" target="_blank" class="thumbnail">
                                                                                <img src='<?php echo $this->config->item("media_folder_service") . $mediaitem->image_name; ?>' />  
                                                                            </a>
                                                                        </td>
                                                                        <td valign="top">
            <?php echo $mediaitem->image_name; ?> 
                                                                            <span class="media_url"><?php echo $this->config->item("media_folder_service") . $mediaitem->image_name; ?></span>
                                                                        </td>

                                                                    </tr>
                                                                </table>

                                                                <div class="btn_area" style="padding-bottom:15px; padding-left:15px; border:none;">
                                                                    <input type="submit" name="submit" id="submit" class="delete_btn" value="Delete photo"/><br style="clear:both;"/>
                                                                </div>

                                                                <?php
                                                            }//end if
                                                        } //end foreach
                                                    }//end if
                                                    ?>

                                                </td>
                                            </tr>



                                        </table>
                                    </form>

                                </td>
                                <td>


<?php $this->load->view('related_activity'); ?>

                                </td>
                            </tr>
                            <tr>
                                <td><img src="<?php echo base_url(); ?>images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
                                <td></td>
                            </tr>
                        </table>

                        <div class="clear"></div>


                    </div>
                    <!--  end content-table-inner  -->
                </td>
                <td id="tbl-border-right"></td>
            </tr>
            <tr>
                <th class="sized bottomleft"></th>
                <td id="tbl-border-bottom">&nbsp;</td>
                <th class="sized bottomright"></th>
            </tr>
        </table>

        <div class="clear">&nbsp;</div>

    </div>
    <!--  end content -->
    <div class="clear">&nbsp;</div>
</div>
<!--  end content-outer -->

<div class="clear">&nbsp;</div>

<?php
$this->load->view('footer')?>